package com.kgc.crow.distributioncrowdcommon.api;

import com.kgc.crow.distributioncrowdcommon.pojo.*;
import com.kgc.crow.distributioncrowdcommon.vo.ProjectVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("DISTRIBUTION-CROWD-DATABASE-PROVIDER")
public interface DataBaseOperationRemoteService {
    @RequestMapping("/database/provider/retrieve/loign/acct/count")
    ResultEntity<Integer> retrieveLoignAcctCount(@RequestParam("loginAcct") String loginAcct);

    @RequestMapping("/database/provider/save/member/remote")
    ResultEntity<String> saveMemberRemote(@RequestBody MemberPo memberPO);

    @RequestMapping("/database/provider/retrieve/member/by/login/acct")
    ResultEntity<MemberPo> retrieveMemberByLoginAcct(@RequestParam("loginAcct") String loginAcct);

    @RequestMapping("/save/project/remote/{memberId}")
    public ResultEntity<String> saveProjectRemote(
            @RequestBody ProjectVO projectVO,
            @PathVariable("memberId") String memberId);

    @RequestMapping("/save/project/select/all/type")
    public ResultEntity<List<TypePO>> selectAllType();

    @RequestMapping("/save/project/select/all/tag")
    public ResultEntity<List<TagPO>> selectAllTag();

    @RequestMapping("/database/provider/retrieve/member/launch/info/po")
    public ResultEntity<MemberLaunchInfoPO> resultEntity(@RequestParam("memberid") Integer memberid);
}
